/**
 * 
 */
package com.cqan.exception.resolver;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import com.cqan.common.ViewModel;

/**
 * @author wuhui
 *
 * 上午11:12:01
 */
public class HandlerAppExceptionResolver implements HandlerExceptionResolver {

	

	@Override
	public ModelAndView resolveException(HttpServletRequest request,
			HttpServletResponse response, Object handler, Exception ex) {
		
		ModelAndView view = new ModelAndView(ViewModel.EXCEPTION);
		view.addObject("message", ex.getLocalizedMessage());
		return view;
	}

}
